package puyu.manage.service.utils;

public class ResponseMsg<T> {

    private Boolean success;
    private T data;
    private String message;

    public ResponseMsg(T data) {
        this(ResultCode.SUCCESS, data);
    }

    public ResponseMsg(ResultCode resultCode, T data) {
        this.success = resultCode.getSuccess();
        this.message = resultCode.getMessage();
        this.data = data;
    }

    public ResponseMsg(ResultCode resultCode, String message, T data) {
        this.success = resultCode.getSuccess();
        this.message = resultCode.getMessage();
        this.data = data;
    }

    public boolean isSuccess() {
        return this.success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String toString() {
        return "ResponseMsg{success=" + this.success + ", data=" + this.data + ", message='" + this.message + '\'' + '}';
    }
}
